package org.glut.AppStoreProject.service;

import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;
import org.glut.AppStoreProject.entity.App;
import org.glut.AppStoreProject.entity.RankingList;
import org.glut.AppStoreProject.mapper.RankingListMapper;
import org.glut.AppStoreProject.utils.MybatisUtil;

import java.util.List;

public class RankingListServiceImapl {
 static Logger logger = Logger.getLogger(RankingListServiceImapl.class);

 //按排行的顺序查询信息
 public List<RankingList> getRankingList() {
  try(
          SqlSession sqlSession = MybatisUtil.getSession()
  ){
   RankingListMapper mapper = sqlSession.getMapper(RankingListMapper.class);
   return mapper.selectrankinglist();
  }catch (Exception e) {
   logger.error("查询排行榜信息失败！");
  }
  return null;
 }
}
